<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // document对象
        //referrer,返回载入当前文档的URL，====获取前一个url对象
        // document.referrer   如果他不是通过超链接访问，他的值为null
        // URL 返回当前的URL

        // ***********最重要的！！！！

        // // id值
        // document.getElementById()

        // //class值===返回集合
        // document.getElementsByClassName()

        // name
        // document.getElementsByName

        // // tag标签===返回集合
        // document.getElementsByTagName()
        // // write()写

    </script>
</head>
<body>
    <img src="./img/d1.jpg" alt="">
    <a href="./cj.html">点击抽奖</a><br/>
    <div id="d1" class="c1">123</div>
    <div id="d2" class="c2">456</div>
    <span id="c1">123</span>

    <input type="button" value="改变123" onclick="gb()">
    <input type="button" value="获取季节" onclick="gb1()">
<br/>
<input type="button" value="获取input值" onclick="gb2()">
<br/>
    <input type="text" value="春" name="season"><br/>
    <input type="text" value="夏" name="season"><br/>
    <input type="text" value="秋" name="season"><br/>
    <input type="text" value="冬" name="season"><br/>

    <div id="s"></div>



    <script>
        function gb(){
            document.getElementById("d1").innerHTML="hhhhhhh"
        }

        function gb1(){
           let sj= document.getElementsByName("season");
           let str="";
           for(let i =0;i<sj.length;i++){
            str+=sj[i].value+"<br/>"
           }
           document.getElementById("s").innerHTML=str;
        }

        function gb2(){
           let sj= document.getElementsByTagName("input");
           let str="";
           for(let i =0;i<sj.length;i++){
            str+=sj[i].value+"<br/>"
           }
           document.getElementById("s").innerHTML=str;
        }


        let aa = document.getElementsByName("season")[1].value;
        console.log(aa);
        


       


    </script>
    
</body>
</html>